# # - 1 登陆
# # 导包
#
# import requests, app
#
# response = requests.post(url=app.BASE_URL + "/api/sys/login",
#                          headers=app.HEADERS,
#                          json={"mobile": "13800000002", "password": "123456"})
# print("登陆的响应数据为：", response.json())
# # - 2 提取登陆的令牌，保存到全局变量
# token = response.json().get("data")
# print("提取的token为：", token)
# app.HEADERS["Authorization"] = "Bearer " + token
# print("令牌保存到全局变量请求头之后的结果为：", app.HEADERS)
#
# response = requests.get(url=app.BASE_URL + "/api/sys/user?page=1&size=10",
#                         headers=app.HEADERS)
#
# print(("查询员工列表的结果为：", response.json()))
# response = requests.post(url=app.BASE_URL + "/api/sys/user",
#                          headers=app.HEADERS,
#                          json={"username": "尼古拉斯赵四", "mobile": "13512795380",
#                                "workNumber": "2020", "timeOfEntry": "2020-01-01",
#                                "formOfEmployment": "1", "departmentId": "9527",
#                                "departmentName": "北京27期测试部", "correctionTime": "2020-12-04"})
# print("添加员工结果为：", response.json())
#
# # 提取员工的ID
# app.EMP_ID=response.json().get("data").get("id")
# print(("提取并保存到全局变量的员工ID为：", app.EMP_ID))
#
# # 查询员工
# response = requests.get(url=app.BASE_URL + "/api/sys/user"+"/"+app.EMP_ID,
#                         headers=app.HEADERS)
#
# print(("查询员工的URL为：", response.url))
# print(("查询员工的URL为：", response.json()))
#
#
# response = requests.put(url=app.BASE_URL + "/api/sys/user"+"/"+app.EMP_ID,
#                         headers=app.HEADERS,
#                         json={"username":"修罗"})
# print("修改员工的URL为：", response.url)
# print("修改员工的结果为：", response.json())
#
#
# response = requests.delete(url=app.BASE_URL + "/api/sys/user"+"/"+app.EMP_ID,
#                            headers=app.HEADERS)
# print(("查询员工的URL为：", response.url))
# print(("查询员工的URL为：", response.json()))



# 定义一个列表字典数据
a = [{"name":"毛宇"}, {"name":"许马华"},{"name":"111"}]
# 开始转化
for i in a:
    print("还是字典：",i)

# 可以通过字典自带的方法itmes.values()来获取字典的value
for i in a:
    print("取出字典的所有value：" , i.values())

# 把取出的数据，转化成元组
for i in a:
    print("把取出的字典数据，转化成元组：", tuple(i.values()))

# 把列表字典，转化成列表元组（这里只提取value）
empty_list = [] # 定义空列表，用于添加转化之后的元组数据
for i in a:
    # 把转换成元组的数据，按照循环次数添加到空列表中，从而做到转化成列表元素数据
    empty_list.append(tuple(i.values()))
    print("每次转化列表元组数据的过程：", empty_list)